/*!
// Testweb v0.4.0
// http://or-change.cn
// Copyright 2014 OrChange Inc. All rights reserved.
// Licensed under the GPL License.
*/

define(function (require, exports, module) {
	'use strict';
	var $ = require("lib/jquery/jquery"),
		OC = require("lib/core/oc"),
		tpm = require("lib/core/controller");
	
	OC.cfg("CURRENT_LANG", OC.cfg("DEFAULT_LANG"));
	window.DEBUG = true;
	window.J = $;
	$(document).ready(function () {
		var url = OC.cfg("TEST_SERVER") + OC.cfg("TEST_SCRIPT_PATH");
		// PROBE initialization
		$("head").html(
			"<title>" + OC.cfg("TITLE") + "</title>" +
			'<link rel="stylesheet" type="text/css" href="' + url + 'View/css/style.css' + '" />'
		);
		$("body").html(
			'<iframe></iframe>' +
			'<div id="mask" class="fix v-max h-max" style="display:none;"></div>'
		);
		$('iframe').attr("src", "/bbs2");

		// Overriding iframe.alert() if DISABLE_ALERT is true.
		if (OC.cfg("DISABLE_ALERT")) {
			$('iframe').load(function () {
				this.contentWindow.alert = function (str) {
					//console.log(str);
				};
			});
		}

		// Rendering console.
		tpm.open("key", {});
	});
});